package org.wu.framework.core.aop.support;

import org.wu.framework.core.Ordered;
import org.wu.framework.core.aop.Advice;
import org.wu.framework.core.aop.PointcutAdvisor;

import java.io.Serializable;

public abstract class AbstractPointcutAdvisor implements PointcutAdvisor, Ordered, Serializable {
    @Override
    public int getOrder() {
        Advice advice = getAdvice();
        if (advice instanceof Ordered ordered) {
            return ordered.getOrder();
        }
        return Ordered.LOWEST_PRECEDENCE;

    }
}
